package com.iscas.green.extralindextest.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;

import com.alibaba.druid.support.http.WebStatFilter;

/**
 * 测试配置类
 */
@Configuration
@Profile("test")
public class TestConfig {
    
    /**
     * 可以在这里添加测试环境特有的bean配置
     * 例如Mock的Feign客户端等
     */
    @Bean
    @Primary
    public FilterRegistrationBean<WebStatFilter> disableDruidWebStatFilter() {
        FilterRegistrationBean<WebStatFilter> registration = new FilterRegistrationBean<>();
        WebStatFilter filter = new WebStatFilter();
        registration.setFilter(filter);
        // 设置为不启用，避免在测试中执行
        registration.setEnabled(false);
        return registration;
    }
} 